package tron.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class KafkaSendServer {

    @Autowired
    KafkaTemplate<String,Object> kafkaTemplate;

    public String sendMsg(String topic,String msg) {
        kafkaTemplate.send(topic, msg);
        return "success";
    }
}
